package com.daylive.service;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.daylive.dao.ChannelDao;
import com.daylive.model.Channel;
import com.daylive.page.Page;
@Service
public class ChannelService {
	private final int PAGE_SIZE = 10;
	@Autowired
	private ChannelDao channelDao;
	public Channel getChannelById(int id) {
		return channelDao.getChannelById(id);
	}
	
	public Page<Channel> getChannelList(int agentId, int pageNumber) {
		Page<Channel> page = new Page<Channel>(pageNumber, PAGE_SIZE);
		List<Channel> list = channelDao.getChannelList(agentId,page);
		page.setResultList(list);
		return page;
	}
	
	public List<Channel> getChannelPushList() {
		List<Channel> list = channelDao.getChannelPushList();
		return list;
	}
	
	public int addChannel(Channel channel) {
		return channelDao.addChannel(channel);
	}
	public int updateChannel(Channel channel) {
		return channelDao.updateChannel(channel);
	}
	public int updateChannelStatus(Channel channel) {
		return channelDao.updateChannelStatus(channel);
	}
	public int delChannel(int id) {
		return channelDao.delChannel(id);
	}
	
	public int delAll(String[] ids) {
		return channelDao.delAll(ids);
	}
	
}
